<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
	<meta http-equiv="cache-control" content="no-store, must-reva lidate"/>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>EMBA云2015你有啥梦想</title>
	<link type="text/css" rel="stylesheet" href="/Public/Home/css/global.css">
	<link type="text/css" rel="stylesheet" href="/Public/Home/css/layout.css">
	<script type="text/javascript" src="/Public/Home/Support/js/jquery-1.7.2.min.js"></script>
	<link rel="stylesheet" type="text/css" href="/Public/Home/js/artDialog4.1.7/skins/black.css"/>
	<script type="text/javascript" src="/Public/Home/js/artDialog4.1.7/artDialog.js"></script>
	<script type="text/javascript" src="/Public/Home/js/artDialog4.1.7/artDialog.config.js"></script>
	<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
	
<!-- 	<script type="text/javascript" src="/Public/Home/js/learn.js"></script> -->
	
	<script type="text/javascript">
		function changeClass(){
			var manager_id = $('select[name="class_manager_id"] option:selected').val();
		 	$.ajax ({
				url:'/Common/changeClass',
				data:'manager_id='+manager_id,
				type:'post',
				success:function(result){
					window.location.reload();
				}
			}); 
		}
	</script>
</head>

<body>
	<!-- header start -->
	<div class="header">
		<div class="header_top">
		    <div class="header_top_logo"><a href="index.html"><!-- <img alt="智慧高校公众平台" src="/Public/images/header_logo.png"> -->EMBA云2015你有啥梦想活动</a></div>
		    <div class="header_top_text">
		    
		    	<!-- <img class="imgmiddle" src="/Public/Home/images/ico_user.png"> -->
		    	<strong></strong><!-- <a class="mr10 ml10" style="color:#fff" href="#" onclick="passwordInput(<?php echo (session('user_id')); ?>);return false;">修改密码</a> -->
		    	<a class="blue" style="color:#fff" href="/Admin/loginOut.html">[退出]</a>
		    </div>
		</div>
	  
	  	<!-- 主导航 start -->
		<div class="header_nav">
		    <ul>
		    <style>
				.header_nav ul li {
				    float: left;
				    margin-right: 2px;
				}
			</style>
	  	 		<li><a href="/Admin/index">梦想</a></li>
	  	 		<li><a href="/Admin/support">参与者</a></li> 
	  	 		<li><a href="/Admin/statistics">数据</a></li><!-- class="cur" -->
			</ul>
		</div>
	  	<!-- 主导航 end -->
	  	
	</div>
	<!-- header end -->





<div class="content">
        <div class="content_search" id="content_search">
            <input type="text" placeholder=" 请输入姓名、手机" id="search" class="w250 h24 searchinput" value="<?php echo ($_GET['search']); ?>">
            <input type="submit" onclick="search();return false;" value="搜索" class="btn">
        </div>
  	<div id="gd_page_list">
  	<div class="content_table mt10 mb10" style="clear:both;">
    <table class="mb10" style="font-size: 14px;">
		<tbody>
		  <tr style="background: none repeat scroll 0% 0% rgb(232, 249, 255);">
		  	<!-- <th width="5%"><input type="checkbox" id="selectAll" /></th> -->
	        <th width="10%">序号</th>
	        <th>梦想标题</th>
	       	<th>支持数</th>
	        <th>浏览数</th>
	        <th>发布者</th>
	        <th>手机号</th>
	        <th>商学院</th>
	        <th>年级</th>
	        <th>关注</th>
	        <th></th>
	        <th colspan="2">操作</th>
	      </tr>
			<?php if(!empty($_list)): if(is_array($_list)): $k = 0; $__LIST__ = $_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><tr>
	      	<!-- <td><input type="checkbox" name="member_id" value="<$vo.member_id>"/></td> -->
	        <td><?php echo ($k); ?></td>
	        <td><?php echo ($vo["user_name"]); ?></td>
			<td><!-- <?php echo ($vo["pass_count"]); ?> --><?php echo ($vo["dbs"]); ?> / <?php echo ($vo["pass_count"]); ?> / <?php echo ($vo["sponsor_count"]); ?></td>
			<td><?php echo ($vo["effect_count"]); ?></td>
	        <td>http://whd.embayun.com/Index/Shareholder?id=<?php echo ($vo["user_id"]); ?></td>
	        <td name="yincang">	
	        	<a href="/Admin/editGd?id=<?php echo ($vo["user_id"]); ?>">编辑</a>
				<a href="/Admin/showPromoters?id=<?php echo ($vo["user_id"]); ?>">查看详情</a>
			</td>
			<td name="yincang">
				<!-- 如果是组长则不可点 -->
				<?php if(($vo["is_leader"]) == "1"): ?><font color="red"><?php echo ($vo["group_name"]); ?></font>
				<?php else: ?>
					<a href="#" onclick="joinGroup(<?php echo ($vo["user_id"]); ?>);return false;">
					<span id="group_name_<?php echo ($vo["user_id"]); ?>">
						<?php if(empty($vo["group_name"])): ?>分组<?php else: echo ($vo["group_name"]); endif; ?>
					</span>
				</a><?php endif; ?>
				
				<!-- <span id="group_name_<?php echo ($vo["user_id"]); ?>"></span> -->
			</td>
	      </tr><?php endforeach; endif; else: echo "" ;endif; ?>
			<?php else: ?>
				<tr>
					<th colspan="6" class="taskStatus">暂无数据</th>
				</tr><?php endif; ?>
		</tbody>
		</table>
	
</div>

<!-- 分页 start-->
<div style="clear:both;"></div>
<div class="manu" id="ajax_page_end"><?php echo ($_page); ?></div>
<!-- <div class="dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_full_numbers" id="DataTables_Table_0_paginate">
	<?php echo ($_page); ?>
</div> -->
	</div>
  
</div>


<script type="text/javascript">
function mateInput(member_id){
	var manager_id = "<?php echo ($_GET['manager_id']); ?>";
	$("#member_contain").hide();
	$("#leadership_page_list").load("/Relation/mateInput?member_id="+member_id+"&manager_id="+manager_id+"&random="+Math.random());
}
var manager_id = '<?php echo ($_REQUEST['manager_id']); ?>';
	$(document).ready(function() {
		//ajaxGdPage();
	});
	
	function search(){
        var search = $('#search').val();
        var grouping_id = $('select[name="grouping_search"] option:selected').val();
        window.location.href = "/Admin/index?search="+search+"&grouping_id="+grouping_id;
	}

	//删除新闻OR活动
	function delMember(member_id){
		art.dialog.confirm('你确定要删除这条记录吗？', function () {
			// 执行确定的操作
			if(member_id == '' || member_id == undefined){
				art.dialog({content:'删除记录的ID不能为空！'});
				return false;
			}
			//提交参数
			var data = {
				member_id: member_id
			};
			$.post("/Leadership/delMember", data,function(result){
				if(result.status == 'LEARN_1023'){
					art.dialog({content:result.info,time:2});
					setTimeout(function(){
						window.location.reload();
					},1000);
				}else{
					art.dialog({content:result.info,time:2});
					return false;
				}
			},"json");
			
		}, function () {
			//隐藏弹出框，不做任何操作
			this.close();
		    return false;//执行取消的操作，这里不执行任何操作
		});
	
	}

	//置顶OR取消
	function setHead(active_id,type){
		var dialog_word;
		//置顶
		if(type=='1'){
			dialog_word = '确定要置顶吗？';
		}else{
			dialog_word = '确定要取消置顶吗？';
		}		
		art.dialog.confirm(dialog_word, function () {
			// 执行确定的操作
			if(active_id == '' || active_id == 'undefined'){
				art.dialog({content:'记录的ID不能为空！'});
				return false;
			}
			//提交参数
			var data = {
				is_head : type,
				active_id: active_id
			};
			$.post("/Active/setHead", data,function(result){
				if(result.status == 'LEARN_1091' || result.status == 'LEARN_1089'){
					art.dialog({content:result.info});
					setTimeout(function(){
						window.location.reload();
					},1000);
				}else{
					art.dialog({content:result.info});
					return false;
				}
			},"json");
			
		}, function () {
			//隐藏弹出框，不做任何操作
			this.close();
		    return false;//执行取消的操作，这里不执行任何操作
		});
	}
	//批量删除
	$('#delAll').click(function(){
			var all_member_id =new Array();
			var i=0;
			$("input[name=member_id]").each(function(){
				if($(this).prop("checked")){
					all_member_id[i]=$(this).val();
					++i;
				}
			});
		//console.log(member_list);return false;
			if(all_member_id==''){
				art.dialog({time:1,content: '请选择人员'});
				return false;
			}
			var all_member_ids = implode(',',all_member_id);
			var json_data = {
					all_member_ids	:	all_member_ids,
			}
			$.ajax({
				type: "POST",
				url: "<?php echo U('/index.php/Leadership/deleteAll');?>?rand="+Math.random(),
				data: json_data,
				dataType:'json',
				success:function(call_back){
					if( 'LEARN_1023' == call_back.status){
						art.dialog({time:1,content: call_back.info});
						//location.href=call_back.url;
						setTimeout(function(){
							window.location.href='/index.php/Leadership/leadershipIndex';
						},300);//延时时间300ms
					}else{
						art.dialog({time:1,content: call_back.info});
					}
					return false;
				}
			});
		});
	
	function joinGroup(user_id){
		var f_title = '';
		f_title = '分组';
		
		var dialog_a = art.dialog({id:'N3690',title: f_title});
		
		$.ajax({
		    url: '/Admin/joinGroup',
		    data: "user_id="+user_id,
		    type: 'post',
		    success: function (call_back) {
		    	dialog_a.content(call_back);
		    },
		    cache: false,
		    dataType: "html"
		});
	}

	function joinGroupSubmit(){
		var grouping_id = $('select[name="grouping_id"] option:selected').val();
		var user_id = $("#user_id").val();
		var group_id_old = $("#group_id_old").val();
		if ((grouping_id == '' || grouping_id == undefined) || (group_id_old == "" && grouping_id == 0)) {
			art.dialog({content:'请选择分组后提交'});
			return false;
		}
		var json_data = {
			user_id : user_id, 
			grouping_id : grouping_id,
			group_id_old : group_id_old
		}
		$.post("/Admin/joinGroupSubmit?rand=" + Math.random(), json_data, function(data) {
			if (data.status == '1') {
				art.dialog({
				    content: data.info,time:1
				});
				window.top.art.dialog({id:'N3690'}).close();
				return false;
			}else {
				art.dialog({content: data.info,time:1});
				window.top.art.dialog({id:'N3690'}).close();
				getGroupName(user_id);
				return false;
				//window.location.reload();
			}
			return false;
		}, "json");
	}
	
	function getGroupName(user_id){
		var json_data = {
				user_id : user_id
			}
			$.post("/Admin/getGroupName?rand=" + Math.random(), json_data, function(data) {
				if (data.status == '0') {

					if(data.data == null){
						$("#group_name_"+user_id).html("分组");
					}else{
						$("#group_name_"+user_id).html(data.data);
					}
					return false;
				}
				return false;
			}, "json");
	}
</script>
<script type="text/javascript" src="/Public/Home/js/tr.js"></script>